﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Seagull.Foundation
{
    /// <summary>
    /// 通过作用域的方式注入服务。
    /// </summary>
    public class ScopedAttribute : BaseDependencyAttribute
    {
        public ScopedAttribute()
        {
        }

        public ScopedAttribute(Type baseType)
        {
            this.BaseType = baseType;
        }

        public Type BaseType { get; }
    }

    /// <summary>
    /// 通过作用域的方式注入
    /// <typeparamref name="TService"/>
    /// 服务。
    /// </summary>
    /// <typeparam name="TService"></typeparam>
    public class ScopedAttribute<TService> : ScopedAttribute
    {
        public ScopedAttribute() : base(typeof(TService))
        {
        }
    }
}
